package com.baiye.www.client;

import com.baiye.www.proxyHandler.ServiceInvocationHandler;

import java.lang.reflect.Proxy;

/**
 * @author GUOZHIPENG
 * @version 1.0
 * @date 2021/12/1 19:57
 */
public class RpcClient {
    public static <T> T getProxyService(Class<T> serviceClass){
        Object o = Proxy.newProxyInstance(serviceClass.getClassLoader(),new Class[]{serviceClass},new ServiceInvocationHandler(serviceClass.getName()));
        return (T) o;
    }
}
